/**
 * Created by meiyun1 on 2017/8/7.
 */
import Vue from 'vue'
import params from '../conf/params'
import { clearEmptyValue } from '../utils/common'
export default {
  getNewsList (search) {
    clearEmptyValue(search)
    return Vue.http.get(`${params.base_url}/newsarticles`, {params: search})
  },
  addNews (news) {
    return Vue.http.post(`${params.base_url}/newsarticle`, news)
  },
  updateNews (id, news) {
    return Vue.http.put(`${params.base_url}/newsarticle/${id}`, news)
  },
  getNewsById (id) {
    return Vue.http.get(`${params.base_url}/newsarticle/${id}`)
  },
  deleteNews (ids) {
    return Vue.http.delete(`${params.base_url}/newsarticle/${ids}`)
  }
}
